package com.lzm.ydpt.entity.mall;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

public class ShopInfoBean implements Parcelable {
    /**
     * store_id	int	店铺id
     * store_name	string	店铺名称
     * address	string	店铺地址
     * distance	int	距离（单位/米）
     * longitude	float	经度
     * latitude	float	纬度
     * resp_mobile	string	电话
     * self_extracting_flag	int	是否支持自取1：可自取，0：不可自取
     * delivery_home_flag	int	是否支持送货上门 1：支持，0：不支持
     * delivery_home_type	int	送货上门类型 1：按范围，2：全县
     * distribution_scope	int	配送范围 （米）
     * distribution_price	int	满多少金额配送 （送货上门）
     * freeprice	int	运费
     * freight_type	int	运费类型 0：包邮，1：满多少包邮，2：固定运费
     * full_decrement_price	int	满减包邮金额
     * delivery_home_freeprice	int	送货上门运费
     * business_start_datetime	string	营业开始时间
     * business_end_datetime	string	营业结束时间
     */
    private long store_id;
    private String store_name;
    private String image_src;
    private double longitude; // "经度",
    private double latitude; // 纬度
    private double distance; // 纬度
    private String address;
    private int count; // 总条数
    private boolean isChoosed;
    private String resp_mobile;
    private int self_extracting_flag;//是否支持自取 1：可自取，0：不可自取
    private int delivery_home_flag;//是否支持送货上门 1：支持，0：不支持
    private int delivery_home_type;// 送货上门类型 1：按范围，2：全县
    private int distribution_scope;// 配送范围 （米）
    private String distribution_price;//: 50,"满多少金额配送 （送货上门）
    private String freeprice;//运费
    private int freight_type;//": 20,//运费类型 0：包邮，1：满多少包邮，2：固定运费
    private String full_decrement_price;//满减包邮金额
    private String delivery_home_freeprice;//送货上门运费
    private String business_start_datetime;//1590976523,
    private String business_end_datetime;//":1590976523
    private List<ShopGoods> goods = new ArrayList<>();

    protected ShopInfoBean(Parcel in) {
        store_id = in.readLong();
        store_name = in.readString();
        image_src = in.readString();
        longitude = in.readDouble();
        latitude = in.readDouble();
        distance = in.readDouble();
        address = in.readString();
        count = in.readInt();
        isChoosed = in.readByte() != 0;
        resp_mobile = in.readString();
        self_extracting_flag = in.readInt();
        delivery_home_flag = in.readInt();
        delivery_home_type = in.readInt();
        distribution_scope = in.readInt();
        distribution_price = in.readString();
        freeprice = in.readString();
        freight_type = in.readInt();
        full_decrement_price = in.readString();
        delivery_home_freeprice = in.readString();
        business_start_datetime = in.readString();
        business_end_datetime = in.readString();
        goods = in.createTypedArrayList(ShopGoods.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(store_id);
        dest.writeString(store_name);
        dest.writeString(image_src);
        dest.writeDouble(longitude);
        dest.writeDouble(latitude);
        dest.writeDouble(distance);
        dest.writeString(address);
        dest.writeInt(count);
        dest.writeByte((byte) (isChoosed ? 1 : 0));
        dest.writeString(resp_mobile);
        dest.writeInt(self_extracting_flag);
        dest.writeInt(delivery_home_flag);
        dest.writeInt(delivery_home_type);
        dest.writeInt(distribution_scope);
        dest.writeString(distribution_price);
        dest.writeString(freeprice);
        dest.writeInt(freight_type);
        dest.writeString(full_decrement_price);
        dest.writeString(delivery_home_freeprice);
        dest.writeString(business_start_datetime);
        dest.writeString(business_end_datetime);
        dest.writeTypedList(goods);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ShopInfoBean> CREATOR = new Creator<ShopInfoBean>() {
        @Override
        public ShopInfoBean createFromParcel(Parcel in) {
            return new ShopInfoBean(in);
        }

        @Override
        public ShopInfoBean[] newArray(int size) {
            return new ShopInfoBean[size];
        }
    };

    public long getStore_id() {
        return store_id;
    }

    public void setStore_id(long store_id) {
        this.store_id = store_id;
    }

    public String getStore_name() {
        return store_name;
    }

    public void setStore_name(String store_name) {
        this.store_name = store_name;
    }

    public String getImage_src() {
        return image_src;
    }

    public void setImage_src(String image_src) {
        this.image_src = image_src;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public boolean isChoosed() {
        return isChoosed;
    }

    public void setChoosed(boolean choosed) {
        isChoosed = choosed;
    }

    public String getResp_mobile() {
        return resp_mobile;
    }

    public void setResp_mobile(String resp_mobile) {
        this.resp_mobile = resp_mobile;
    }

    public int getSelf_extracting_flag() {
        return self_extracting_flag;
    }

    public void setSelf_extracting_flag(int self_extracting_flag) {
        this.self_extracting_flag = self_extracting_flag;
    }

    public int getDelivery_home_flag() {
        return delivery_home_flag;
    }

    public void setDelivery_home_flag(int delivery_home_flag) {
        this.delivery_home_flag = delivery_home_flag;
    }

    public int getDelivery_home_type() {
        return delivery_home_type;
    }

    public void setDelivery_home_type(int delivery_home_type) {
        this.delivery_home_type = delivery_home_type;
    }

    public int getDistribution_scope() {
        return distribution_scope;
    }

    public void setDistribution_scope(int distribution_scope) {
        this.distribution_scope = distribution_scope;
    }

    public String getDistribution_price() {
        return distribution_price;
    }

    public void setDistribution_price(String distribution_price) {
        this.distribution_price = distribution_price;
    }

    public String getFreeprice() {
        return freeprice;
    }

    public void setFreeprice(String freeprice) {
        this.freeprice = freeprice;
    }

    public int getFreight_type() {
        return freight_type;
    }

    public void setFreight_type(int freight_type) {
        this.freight_type = freight_type;
    }

    public String getFull_decrement_price() {
        return full_decrement_price;
    }

    public void setFull_decrement_price(String full_decrement_price) {
        this.full_decrement_price = full_decrement_price;
    }

    public String getDelivery_home_freeprice() {
        return delivery_home_freeprice;
    }

    public void setDelivery_home_freeprice(String delivery_home_freeprice) {
        this.delivery_home_freeprice = delivery_home_freeprice;
    }

    public String getBusiness_start_datetime() {
        return business_start_datetime;
    }

    public void setBusiness_start_datetime(String business_start_datetime) {
        this.business_start_datetime = business_start_datetime;
    }

    public String getBusiness_end_datetime() {
        return business_end_datetime;
    }

    public void setBusiness_end_datetime(String business_end_datetime) {
        this.business_end_datetime = business_end_datetime;
    }

    public List<ShopGoods> getGoods() {
        return goods;
    }

    public void setGoods(List<ShopGoods> goods) {
        this.goods = goods;
    }
}